#include <iostream>
#include <winsock.h>
#include <map>
#include <string>
#include <conio.h>
#pragma comment(lib, "wsock32.lib")
#include <vector>
               //ip                    file
std::multimap<std::string, std::string> Database; 
std::multimap<std::string, std::string>:: iterator Iter;
static int shared = 4444;
static int connected = 3135;
struct Packet //structure for data from client
{
	char choise;
	char ReturnAddr[256];
	char NameFile[256];
};
class FileG {   
public:
    FILE *_f;
    FileG(){};
    FileG(FILE *f){
        _f=f;
    }    
    ~FileG(){
        fclose(_f);        
    }   
};
class SocketG { 
public:
    SOCKET _a;
    SocketG(){};
    SocketG(SOCKET a){_a = a;};
    ~SocketG(){
        closesocket(_a);}   
};
class WSADataG { 
public:
    WSAData _WS;
    WSADataG(){};
    WSADataG(WSAData ws){_WS = ws;};
    ~WSADataG(){
        WSACleanup();}   
};
class ThreadG { 
public:
    HANDLE _th;
    ThreadG(){};
    ThreadG(HANDLE th){_th = th;};
    ~ThreadG(){
        CloseHandle(_th);}   
};